import it.trekker.dao.DAOFactory;
import it.trekker.dao.Excursion;
import it.trekker.dao.ExcursionCoordinate;
import it.trekker.dao.IExcursionDAO;
import it.trekker.dao.IExcursionCoordinateDAO;
import it.trekker.dao.IPoiDAO;
import it.trekker.dao.IUserDAO;
import it.trekker.dao.Poi;
import it.trekker.dao.User;
import it.trekker.dao.ejb.EJB3DAOFactory;


public class CleanUp {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		DAOFactory daoFactory = DAOFactory.getDAOFactory(EJB3DAOFactory.class.getName());
		IExcursionDAO excursionDAO = daoFactory.getExcursionDAO();
		IUserDAO userDAO = daoFactory.getUserDAO();
		IExcursionCoordinateDAO excursionCoordinateDAO = daoFactory.getExcursionCoordinateDAO();
		IPoiDAO poiDAO = daoFactory.getPoiDAO();
		
		for(ExcursionCoordinate coord : excursionCoordinateDAO.findAllCoordinates()) {
			excursionCoordinateDAO.remove(coord.getId());
		}
		
		for(Poi poi : poiDAO.findAllPois()) {
			poiDAO.remove((int) poi.getId());
		}
		
		for(Excursion excursion : excursionDAO.findAllExcursions()) {
			excursionDAO.remove(excursion.getId());
		}
		
		for(User user : userDAO.findAllUsers()) {
			userDAO.remove(user.getId());
		}
	}

}
